<script type="text/javascript">
<!--
{literal}
    $(document).ready(function(){
        $('#paraclinicalType').click(function(){
            $("#deleteServiceFrm input[name='serviceItemId']").attr('disabled', 'disabled');
            $("#deleteServiceFrm input[name='paraclinicalItemId\[\]']").removeAttr('disabled');
            $("#deleteServiceFrm input[name='paraclinicalItemId\[\]']").attr('checked', 'checked');
        });
        $('#serviceType').click(function(){
            $("#deleteServiceFrm input[name='serviceItemId']").removeAttr('disabled');
            $("#deleteServiceFrm input[name='serviceItemId']:first").attr('checked','checked');
            $("#deleteServiceFrm input[name='paraclinicalItemId\[\]']").attr('disabled', 'disabled');
        });
        {/literal}
            {if !empty($serviceModelList)}
            $('#deleteServiceFrm #serviceType').attr('checked', 'checked');
            $("#deleteServiceFrm input[name='serviceItemId']:first").attr('checked','checked');
            {else}
            $('#deleteServiceFrm #paraclinicalType').attr('checked', 'checked');
            $("#deleteServiceFrm input[name='paraclinicalItemId\[\]']").attr('checked', 'checked');
            {/if}
        {literal}
    });
{/literal}
//-->
</script>
<div>
    <form id="deleteServiceFrm">
        <input type="hidden" name="ticketItemId" id="ticketItemId" value="{$ticketItemId}">
        <input type="hidden" name="ticketId" value="{$ticketId}">
        {if isset($deleteCurrentItem)}
	        <div style="padding-bottom: 15px; padding-top: 5px;">{translate p1=$serviceName}Are you sure to delete the in-progress service <span class='impression'>%s</span>{/translate} ?</div>
	        {if !empty($serviceModelList)}
	            <div><span style="font-style: italic;">{translate}Select next service to be performed{/translate}</span></div>
	            {foreach from=$serviceModelList item=itemModel}
	            <div style="padding-left: 20px; padding-top: 5px;">
	                <table>
	                    <tbody>
	                        <tr valign="top">
	                            <td style="width: 20px;"><input type="radio" name="serviceItemId" value="{$itemModel->getTicketItemId()}"></td>
	                            <td style="width: 200px;">{$itemModel->getServiceName()}</td>
	                            <td style="padding-left: 10px;"><span class="label">{$itemModel->getRoomName()}</span></td>
	                        </tr>
	                    </tbody>
	                </table>
	            </div>
	            {/foreach}
	        {else}
	            <div>
	               <span style="font-style: italic;">{translate}Note{/translate}:</span><br/>
	               <div style="padding-left: 20px; padding-top: 5px;">{translate}This service is the last undone service of examination-surgery type{/translate}</div>
	               <div style="padding-left: 20px; padding-top: 5px;">{translate}Deleting this service forces the ticket finished{/translate}!</div>
                </div>
            {/if}
        {else}
            <div style="padding-top: 5px;">{translate p1=$serviceName}Are you sure to delete service <span class='impression'>%s</span>{/translate} ?</div>
        {/if}
    </form>
</div>